package ics.nodes.event;

import ics.DateParentNode;
import ics.nodes.Constants;

import java.time.Instant;
import java.util.Date;

public class DTStart extends DateParentNode {

    @Deprecated
    public DTStart(Date date) {
        super(Instant.ofEpochMilli(date.getTime()));
        setName(Constants.DTSTART);
    }

    public DTStart(Instant instant) {
        super(instant);
        setName(Constants.DTSTART);
    }

    @Override
    public String toString() {
//        DTSTART;TZID=Asia/Shanghai:20191024T150000
        return getName() + ";" + Constants.TZID + "=" + getZoneId().getId() + ":" + getValue();
    }
}
